package com.etlmaster.transformer.funcs;

import java.util.HashMap;
import java.util.Map;

import com.etlmaster.executor.annotation.StepInstruction;
import com.etlmaster.executor.trans.core.Line;
import com.etlmaster.executor.trans.core.LineTransProcessor;


/**
 * 增加字段
 * @author Wugf
 * @date 2017-03-08
 */
@StepInstruction("addField")
public class TransFieldAdd  extends LineTransProcessor{

	private String value;
	private String paramName;
	private Map<String,String> map;
	private String colName;
	public TransFieldAdd(String sourceTab,String sourceCol,String targetTab,String targetCol,String changeCode,Map paramStr,Map var){
		
		super( sourceTab,sourceCol,targetTab,targetCol,changeCode, paramStr,var);
	
		map=new HashMap<String,String>();
	}


	public String getValue() {
		return this.varaibleSubstution(value);
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getParamName() {
		return paramName;
	}

	public void setParamName(String paramName) {
		this.paramName = paramName;
	}

	@Override
	public void transField(Line line) {
		
		line.addField(getValue(),this.getSourceTab(),colName);
	}

}
